<?php use_stylesheet('orders.css')?>

<div id="orders">
  <?php foreach($categories as $category):?>
  <div class="category_<?php echo Briefing::slugify($category->getCategoryname())?>">
    <div class="category">
      <div class="feed">
        <a href="">Feed</a>
      </div>
      <h1><?php echo link_to($category, 'category', $category) ?></h1>
    </div>  

    <?php include_partial('order/list', array('orders' => $category->getActiveOrders(sfConfig::get('app_max_orders_on_homepage')))) ?>
    
    <?php 
      if (($count = $category->countActiveOrders() - sfConfig::get('app_max_orders_on_homepage')) > 0): ?>
          <div class="more_orders">
          and <?php echo link_to($count, 'category', $category) ?>
          more...
          </div>
      <?php endif; ?>
  </div>
  <?php endforeach; ?>
</div>